import Vue from 'vue';

import VueRouter from 'vue-router';

import Home from '../view/home/index.vue';
Vue.use(VueRouter);
export default function createRouter() {
  return new VueRouter({
    mode: 'history',
    base: '/',
    routes: [
      {
        path: '/',
        component: Home
      },
      {
        path: '/jcd',
        component: JCD,
        redirect: '/jcd/scan',
        children:[
          {
            path: 'scan',
            component: ()=>import('../view/jianchadang/scan.vue'),
          },
          {
            path: 'detail',
            component: ()=>import('../view/jianchadang/detail.vue'),
          },
          {
            path: 'inputData',
            component: ()=>import('../view/jianchadang/inputData.vue'),
          }
        ]
      },
      // {
      //   path: '/detail/:id',
      //   component: () => import('./detail')
      // }
    ]
  });
}

